import 'package:flutter/material.dart';

class WebBottombar extends StatelessWidget {
  final Future<bool> Function() onBack;
  const WebBottombar({super.key, required this.onBack});

  void onPop(BuildContext context) async {
    if (await onBack()) { return; }
    if (context.mounted) { 
      Navigator.pop(context);
    }
  }

  @override
  Widget build(BuildContext context) {
    return Column(mainAxisAlignment: MainAxisAlignment.start, children: [
      Container(color: Colors.black54, height: 0.2),
      Expanded(child: 
      Container(color: Colors.grey.shade50, 
      child: Row(mainAxisAlignment: MainAxisAlignment.start, children: [
        IconButton(onPressed: () => onPop(context), icon: const Icon(Icons.arrow_back))
      ])))
    ]);
  }
}
